﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GibbsLDASharp.LDA
{
    public class Pair : IComparable<Pair>
    {
        public Object first;
        public IComparable second;
        public static bool naturalOrder = false;

        public Pair(Object k, IComparable v)
        {
            first = k;
            second = v;
        }

        public Pair(Object k, IComparable v, bool naturalOrder)
        {
            first = k;
            second = v;
            Pair.naturalOrder = naturalOrder;
        }

        public int CompareTo(Pair p)
        {
            if (naturalOrder)
                return this.second.CompareTo(p.second);
            else return -this.second.CompareTo(p.second);
        }
    }
}
